<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        
        <script src="/ukkepuk/source/html/scripts/jquery-1.7.1.js"></script>
        <script src="/ukkepuk/source/html/scripts/topmenu.js"></script>
        <script src="/ukkepuk/source/html/scripts/kidmanage.js"></script>
        
        <script>
        
        function addUser() {
            
            $.ajax({
                url: 'actions/useractions.php',
                type: "POST",
                data: {username: $("#username").attr("value"), password: $("#password").attr("value"), action: "saveUser"},
                dataType: "xml",
                success: function(data) {
                    //$('.result').html(data);

                    if($(data).find("result").attr("status") == "error"){
                        $(".errormsg").html($(data).find("error").attr("descr"));
                    }
                    else if($(data).find("result").attr("status") == "ok"){
                        //handle success
                        alert("ok");
                    }
                }
            });
        }
        </script>
        <style type="text/css" media="all">
            @import url("/ukkepuk/source/html/css/ukkepukmain.css");
            @import url("/ukkepuk/source/html/css/kidsthumb.css");
            @import url("/ukkepuk/source/html/css/topmenu.css");
        </style>
    </head>
    <body>
        <div id="main">
            <?php require_once($_SERVER['DOCUMENT_ROOT'] . '/ukkepuk/source/php/panels/topmenu.php'); ?>
            <?php include($_SERVER['DOCUMENT_ROOT'] . '/ukkepuk/source/php/panels/UserTileList.php'); ?>
            <div id="content">
                <form>
                    <table>
                        <tr>
                            <td>Username: </td>
                            <td><input type="text" id="username" name="username"/></td>
                        </tr>
                        <tr>
                            <td>Password: </td>
                            <td><input type="text" id="password" name="password"/></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><img width="16px" src="/ukkepuk/webcontent/images/add.png" onclick="addUser()" /></td>
                        </tr>
                    </table>
                </form>
            </div>        
        </div>
    </body>
</html>
